package com.lm.rabbitmq.controller;

import com.lm.rabbitmq.service.Producer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private Producer producer;

    @GetMapping("/send")
    public String send(@RequestParam String msg) {
        producer.send(msg);
        return "消息发送成功: " + msg;
    }
}